<?php 
class WJG_Resource_Thumbnail extends WJG_Resource_Imaging {
    private $image;
    private $width;
    private $height;
   
    function __construct($image,$width,$height) {
    
    parent::set_img($image);
   
    parent::set_quality(100);
    parent::set_size();
    
                //$this->thumbnail= pathinfo($image, PATHINFO_DIRNAME).pathinfo($image, PATHINFO_FILENAME).'_tn.'.pathinfo($image, PATHINFO_EXTENSION);
	$imagepath = str_replace('.'.pathinfo($image, PATHINFO_EXTENSION), '', $image);
        
        $image320 =str_replace('/note/','/thumb_note/',$imagepath);
        $image480 =str_replace('/note/','/medium_note/',$imagepath);
        $image800 =str_replace('/note/','/note/',$imagepath);
//        die;
    $this->img_320= $image320.'_320.'.pathinfo($image, PATHINFO_EXTENSION);
    $this->img_480 =  $image480.'_480.'.pathinfo($image, PATHINFO_EXTENSION);
    $this->img_800 =  $image800.'_800.'.pathinfo($image, PATHINFO_EXTENSION);
//    $this->thumbnail = 'thumb_'.$image;
    

    parent::save_img($this->img_320,120);
    parent::save_img($this->img_480,480);
    parent::save_img($this->img_800,800);
    parent::clear_cache();
        }
        function __toString() {
                return $imagepath;
        }
}